'use strict';

module.exports = app => {
    app.beforeStart(async () => {
      // 从配置中心获取 MySQL 的配置
      // { host: 'localhost', port: '3306', user: 'root', password: 'root', database: 'equipment' }
      const mysqlConfig = await app.configCenter.fetch('mysql');
      app.database = app.mysql.createInstance(mysqlConfig);
    });
  };